package com.example.alibabasentinelnacos.web;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RefreshScope
public class HelloController {
    @Value("${name:}")
    private String name = "world";

    @PostMapping("/sayHello")
    public String sayHello(@RequestBody Foo foo) {
        return "hello " + name + ", foo=" + foo.toString();
    }
}
